package com.xxx.springboot;

import cn.shuibo.annotation.EnableSecurity;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.xxx.springboot.listener.SystemListener;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@SpringBootApplication
@NacosPropertySource(dataId = "example", autoRefreshed = true)   // 配置多个nacos配置文件
@NacosPropertySource(dataId = "user.properties", autoRefreshed = true)   // 配置多个nacos配置文件
@MapperScan("com.xxx.springboot.mapper")
@EnableSecurity       // 开启RSA加密注解
public class Application {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(Application.class);
        springApplication.addListeners(new SystemListener()); // 添加listener
        springApplication.run(args);
    }

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

}
